import { computed } from 'vue'

export const getStatusText = (status: number, payStatus: number) => {
  if (status === 0 && payStatus === 0) {
    return '待付款';
  }
  if (status === 1 && payStatus === 1) {
    return '待交货';
  }
  if (status === 2 && payStatus === 1) {
    return '待收货';
  }
  if (status === 3 && payStatus === 1) {
    return '已完成';
  }
  if (status === 4) {
    return '已取消';
  }
  if (status === 5) {
    return '退款中';
  }
  if (status === 6) {
    return '已退款';
  }
}

export const grayCustomStyle = computed(() => {
  return {
    color: '#000',
    backgroundColor: '#eee',
    height: '50rpx',
    fontSize: '28rpx',
    border: 'none'
  }
})
export const mainCustomStyle = computed(() => {
  return {
    color: '#fff',
    backgroundColor: '#ff7744',
    height: '50rpx',
    fontSize: '28rpx',
    border: 'none'
  }
})

export const imageStyle = computed(() => {
  const w = uni.upx2px(750) / 5
  const rate = w / 600
  const h = rate * 400
  return {
    width: w + 'px',
    height: h + 'px'
  }
})